<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:83:"D:\Software\phpstudy_pro\WWW\asks\public/../application/admin\view\product\add.html";i:1639384096;s:73:"D:\Software\phpstudy_pro\WWW\asks\application\admin\view\common\meta.html";i:1639278409;s:75:"D:\Software\phpstudy_pro\WWW\asks\application\admin\view\common\script.html";i:1635431232;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <!-- 样式 -->
    <meta charset="UTF-8">
<title><?php echo $system['siteAdminName']; ?></title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="shortcut icon" href="<?php echo $system['siteAdminLogo']; ?>" type="image/x-icon" />
<link rel="stylesheet" href="\static\admin\css/font.css">
<link rel="stylesheet" href="\static\admin\css/xadmin.css">

    <!-- js文件 -->
    <script src="\static\admin\js/jquery.min.js"></script>
<script src="\static\admin\lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="\static\admin\js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-form-label {
            width: 140px;
        }

        .layui-form-item .layui-input-inline {
            width: 300px;
        }

        .preview {
            width: 80px;
            height: 80px;
            margin: 2px;
        }
    </style>
</head>

<body>
    <div class="x-body">
        <form class="layui-form" method="POST" enctype="multipart/form-data">
            <!-- 商品分类 -->
            <div class="layui-form-item">
                <label class="layui-form-label">商品分类</label>
                <div class="layui-input-inline">
                    <select name="type" lay-verify="required" lay-filter="type">
                        <option value="0">请选择商品分类</option>
                        <?php foreach($typeList as $v): ?>
                        <option value="<?php echo $v['id']; ?>"><?php echo $v['name']; ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
            <!-- 商品名称 -->
            <div class="layui-form-item">
                <label for="name" class="layui-form-label">
                    <span class="x-red">*</span>商品名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="name" name="name" required autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 商品价格 -->
            <div class="layui-form-item">
                <label for="price" class="layui-form-label">
                    <span class="x-red">*</span>商品价格
                </label>
                <div class="layui-input-inline">
                    <input type="number" id="price" name="price" required autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 商品库存 -->
            <div class="layui-form-item">
                <label for="stock" class="layui-form-label">
                    <span class="x-red">*</span>商品库存
                </label>
                <div class="layui-input-inline">
                    <input type="number" id="stock" name="stock" required autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 商品图集 -->
            <div class="layui-form-item">
                <label class="layui-form-label">
                    商品图集
                </label>
                <div class="layui-input-inline">
                    <div class="layui-upload">
                        <!-- 隐藏域 用于保存多张图片 -->
                        <input type="file" name="files[]" multiple="multiple" id="file" hidden>
                        <button type="button" class="layui-btn" id="type" onclick="file.click()">
                            上传文件
                        </button>
                        <!-- <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                            预览图：
                            <div class="layui-upload-list" id="imgbox"></div>
                        </blockquote> -->
                    </div>
                </div>



            </div>
            <!-- 商品详细 -->
            <div class="layui-form-item">
                <label for="content" class="layui-form-label">
                    <span class="x-red">*</span>商品详细
                </label>
                <div class="layui-input-inline">
                    <textarea name="content" lay-verify="required" placeholder="请输入商品详细"
                        class="layui-textarea"></textarea>
                </div>
            </div>
            <!-- 提交按钮 -->
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button class="layui-btn" lay-filter="add" type="submit">
                    增加
                </button>
                <button type="reset" class="layui-btn layui-btn-danger">重置</button>
            </div>
        </form>
    </div>
    <script>
        layui.use(['form', 'layer', 'jquery', 'upload'], function () {
            $ = layui.jquery;
            var form = layui.form
                , upload = layui.upload
                , layer = layui.layer;

            // //上传图片
            // var uploadInst = upload.render({
            //     // 绑定元素
            //     elem: '#type',
            //     // 禁用自动上传
            //     auto: false,
            //     // 设置字段名
            //     file: 'file',
            //     //多文件上传
            //     multiple: true,
            //     choose: function (obj) { //选择文件后的回调函数
            //         //预读本地文件示例，不支持ie8 
            //         obj.preview(function (index, file, result) {
            //             //给图片设置src显示属性
            //             $('#imgbox').append(`<img class="layui-upload-img preview" id="preview${index}" />`)
            //             $(`#preview${index}`).attr('src', result); //图片链接（base64）
            //         })
            //     }
            // })
        });

    </script>
</body>

</html>